﻿using ConsoleAppFramework.Util;
using System.Collections.Generic;

namespace ConsoleAppFramework.Service
{
    public class DistinctService
    {
        private string conn_proapp => Just.Library.Util.ConfigHelper.GetConnectionString("yanh");
        public List<District> GetList()
        {
            var cmdText = $@"SELECT name AS Name,id AS Id,code AS Code
              FROM proapp.district
              WHERE 1=1";
            DapperHelper_MySql dapperDal = new DapperHelper_MySql(conn_proapp);
            var list = dapperDal.Query<District>(cmdText);
            return list;
        }
    }

    public class District
    {
        public int Id { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
    }
}
